package com.maltys.jedis.controller;

import com.maltys.jedis.oper.RedisOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Set;

@RestController
public class StringOperationController {
    @GetMapping("/set/random")
    public String setRandomKey() {
        String s = RedisOperation.setRandomKey();
        return s;
    }

    @GetMapping("/get/all_keys")
    public Set<String> getAllKeys() {
        return RedisOperation.getAllKeys();
    }
    @GetMapping("/get/key")
    public String getAllKeys(String  key) {
        return RedisOperation.getKey(key);
    }
}
